import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    sellers: {},
    goods: [],
    ratings: []
  },
  actions: {
    getinfo (init, data) {
      init.commit('initdata', data)
      // console.log(data)
    }
  },
  mutations: {
    initdata (state, data) {
      state.sellers = data.seller
      state.goods = data.goods
      state.ratings = data.ratings
    }
  }
})
